﻿@using KRM.Core
@{
    var arrInt = new int[] { 34, 2, 3, 4, 5 };
    KRMEntities db = ViewBag.db;
    var refundRequest = ViewBag.RefundRequest as tblKRMRefundRequest;
}

<form class="margin0" method="POST" id="frFullRefundRequest">
    <input name="refundRequestId" type="hidden" class="hfrefundrequestid" value="@refundRequest.RefundRequestID"/>
    <input name="OrderID" type="hidden" value="@ViewBag.OrderID"/>

    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span10">
            <h4>ACCOUNTS:</h4>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Date Placed:</div>
        <div class="span8">@ViewBag.DatePlaced</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Cancellation Date:</div>
        <div class="span8">@ViewBag.CancelDate</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Order Number:</div>
        <div class="span8">@ViewBag.OrderNumber</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Billing Name/Address:</div>
        <div class="span8">@ViewBag.BillNameAddress</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Shipping Name/Address:</div>
        <div class="span8">@ViewBag.ShipNameAddress</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Suppelier:</div>
        <div class="span8">@ViewBag.Supperlier</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Product:</div>
        <div class="span8">
            <textarea class="input-block-level" readonly="readonly" id="txtProduct">@ViewBag.Product</textarea>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Amount of Refund: </div>
        <div class="span8">
            <input type="text" class="input-block-level" value="@ViewBag.AmountRefund" id="txtamount"  />
        </div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Total Order Vaule:</div>
        <div class="span8">@ViewBag.TotalOrderValue</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Payment Method:</div>
        <div class="span8">@ViewBag.PaymentMethod</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Cancelled By:</div>
        <div class="span8">@ViewBag.CancelBy</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span2 bold">Cancellation Reason:</div>
        <div class="span8">@ViewBag.CancelReason</div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span10 bold">
            Cancellation Details:
        <textarea class="input-block-level">@ViewBag.CancellationDetails</textarea>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span1"></div>
        <div class="span5">
            <fieldset>
                <legend class="bold">Goods Despatched?</legend>
                <div class="row-fluid">
                    <div class="span6 bold">
                        <label>
                            <input type="radio" class="cbcheck" @(refundRequest.IsDespatched == true ? "checked=checked" : "") value="true"  name="despatched"/>
                            Yes</label>
                    </div>
                    <div class="span6 bold">
                        <label>
                            <input type="radio" class="cbcheck" @(refundRequest.IsDespatched == null || refundRequest.IsDespatched == false ? "checked=checked" : "") value="false"  name="despatched"/>
                            No</label>
                    </div>
                </div>
                <div class="row-fluid">
                    <div style="color: red">
                        Yes: We need to collect the item, so the request will go Pending Collection.<br />
                        No: The request goes straight into Pending Refund.
                    </div>
                </div>
            </fieldset>
        </div>
        <div class="span5">
            <fieldset style="height: 114px;">
                <legend class="bold">Direct Despatch?</legend>
                <div class="row-fluid">
                    <div class="span6 bold">
                        <label>
                            <input type="radio" class="cbcheck" @(refundRequest.IsDD == true ? "checked=checked" : "") value="true" name="isDD" />
                            Yes</label>
                    </div>
                    <div class="span6 bold">
                        <label>
                            <input type="radio" class="cbcheck" @(refundRequest.IsDD == null || refundRequest.IsDD == false ? "checked=checked" : "") value="false" name="isDD" />
                            No</label>
                    </div>
                </div>
            </fieldset>
        </div>
    </div>
</form>
<form method="POST" id="frFullRefundQuestionCheck">
    <input name="refundRequestId" type="hidden" class="hfrefundrequestid" value="@refundRequest.RefundRequestID"/>
    @foreach (var item in arrInt)
    {
        var type = db.Database.SqlQuery<string>("select RefundQuestionType from tblKRMRefundQuestions where RefundQuestionID = " + item).FirstOrDefault();
        if (!string.IsNullOrEmpty(type) && type.Equals("Check"))
        {
        @Html.Action("ucCheckRefund", "OrderView", new { refundQuestionId = item, refundRequestId = refundRequest.RefundRequestID })
        }
    }
</form>
<form method="POST" id="frRefundQuestionTextList">
    <input name="refundRequestId" type="hidden" class="hfrefundrequestid" value="@refundRequest.RefundRequestID"/>
    @foreach (var item in arrInt)
    {
        var type = db.Database.SqlQuery<string>("select RefundQuestionType from tblKRMRefundQuestions where RefundQuestionID = " + item).FirstOrDefault();
        if (!string.IsNullOrEmpty(type) && type.Equals("TextList"))
        {
        @Html.Action("ucTextListRefund", "OrderView", new { refundQuestionId = item, refundRequestId = refundRequest.RefundRequestID })
        }
    }
</form>
<form method="POST" id="frRefundQuestioCheckList">
    <input name="refundRequestId" type="hidden" class="hfrefundrequestid" value="@refundRequest.RefundRequestID"/>
    @foreach (var item in arrInt)
    {
        var type = db.Database.SqlQuery<string>("select RefundQuestionType from tblKRMRefundQuestions where RefundQuestionID = " + item).FirstOrDefault();
        if (!string.IsNullOrEmpty(type) && type.Equals("CheckList"))
        {
        <div class="row-fluid">
            <div class="span1"></div>
            <div class="span10">
                @Html.Action("ucCheckList", "OrderView", new { refundQuestionId = item, refundRequestId = refundRequest.RefundRequestID })
            </div>
        </div>
        }
    }
</form>

